{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sqlalchemy\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sqlalchemy import create_engine\n",
    "\n",
    "conn = create_engine(\"mysql+pymysql://root:123456@localhost:3306/work_sql_1?charset=utf8\")\n",
    "\n",
    "# \"C:\\ProgramData\\MySQL\\MySQL Server 8.0\\Data\\work_sql_1\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>销售id</th>\n",
       "      <th>销售姓名</th>\n",
       "      <th>沟通用户总数</th>\n",
       "      <th>直接成单数</th>\n",
       "      <th>跟单成功数</th>\n",
       "      <th>总成单数</th>\n",
       "      <th>直接成单率</th>\n",
       "      <th>跟单成功率</th>\n",
       "      <th>成单率</th>\n",
       "      <th>非意向用户</th>\n",
       "      <th>跟单失败数</th>\n",
       "      <th>非意向用户率</th>\n",
       "      <th>跟单失败率</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>张艳</td>\n",
       "      <td>1040</td>\n",
       "      <td>66</td>\n",
       "      <td>36</td>\n",
       "      <td>102</td>\n",
       "      <td>0.0635</td>\n",
       "      <td>0.0346</td>\n",
       "      <td>0.0981</td>\n",
       "      <td>431</td>\n",
       "      <td>148</td>\n",
       "      <td>0.4144</td>\n",
       "      <td>0.1423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>李勇</td>\n",
       "      <td>1029</td>\n",
       "      <td>54</td>\n",
       "      <td>16</td>\n",
       "      <td>70</td>\n",
       "      <td>0.0525</td>\n",
       "      <td>0.0155</td>\n",
       "      <td>0.0680</td>\n",
       "      <td>515</td>\n",
       "      <td>197</td>\n",
       "      <td>0.5005</td>\n",
       "      <td>0.1914</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>王平</td>\n",
       "      <td>1046</td>\n",
       "      <td>45</td>\n",
       "      <td>14</td>\n",
       "      <td>59</td>\n",
       "      <td>0.0430</td>\n",
       "      <td>0.0134</td>\n",
       "      <td>0.0564</td>\n",
       "      <td>385</td>\n",
       "      <td>163</td>\n",
       "      <td>0.3681</td>\n",
       "      <td>0.1558</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>李强</td>\n",
       "      <td>995</td>\n",
       "      <td>36</td>\n",
       "      <td>15</td>\n",
       "      <td>51</td>\n",
       "      <td>0.0362</td>\n",
       "      <td>0.0151</td>\n",
       "      <td>0.0513</td>\n",
       "      <td>433</td>\n",
       "      <td>144</td>\n",
       "      <td>0.4352</td>\n",
       "      <td>0.1447</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>王芳</td>\n",
       "      <td>1027</td>\n",
       "      <td>30</td>\n",
       "      <td>32</td>\n",
       "      <td>62</td>\n",
       "      <td>0.0292</td>\n",
       "      <td>0.0312</td>\n",
       "      <td>0.0604</td>\n",
       "      <td>419</td>\n",
       "      <td>143</td>\n",
       "      <td>0.4080</td>\n",
       "      <td>0.1392</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   销售id 销售姓名  沟通用户总数  直接成单数  跟单成功数  总成单数   直接成单率   跟单成功率     成单率  非意向用户  \\\n",
       "0     1   张艳    1040     66     36   102  0.0635  0.0346  0.0981    431   \n",
       "1     2   李勇    1029     54     16    70  0.0525  0.0155  0.0680    515   \n",
       "2     3   王平    1046     45     14    59  0.0430  0.0134  0.0564    385   \n",
       "3     4   李强     995     36     15    51  0.0362  0.0151  0.0513    433   \n",
       "4     5   王芳    1027     30     32    62  0.0292  0.0312  0.0604    419   \n",
       "\n",
       "   跟单失败数  非意向用户率   跟单失败率  \n",
       "0    148  0.4144  0.1423  \n",
       "1    197  0.5005  0.1914  \n",
       "2    163  0.3681  0.1558  \n",
       "3    144  0.4352  0.1447  \n",
       "4    143  0.4080  0.1392  "
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_data = pd.read_sql(\n",
    "    \"select * from v1;\",\n",
    "    conn\n",
    ")\n",
    "\n",
    "df_data.head()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_data[\"底薪\"] = 2000\n",
    "df_data[\"直接成单奖励\"] = 0\n",
    "df_data[\"跟单成功奖励\"] = 0\n",
    "\n",
    "df_data[\"直接成单数最高者奖励\"] = 0\n",
    "\n",
    "df_data[\"跟成单数最高者奖励\"] = 0\n",
    "\n",
    "df_data[\"跟单成功数最高者奖励\"] = 0\n",
    "\n",
    "df_data[\"总成单数最高者奖励\"] = 0\n",
    "\n",
    "df_data[\"总成单率最高者奖励\"] = 0\n",
    "\n",
    "df_data[\"总工资\"] = 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['销售id', '销售姓名', '沟通用户总数', '直接成单数', '跟单成功数', '总成单数', '直接成单率', '跟单成功率',\n",
       "       '成单率', '非意向用户', '跟单失败数', '非意向用户率', '跟单失败率', '底薪', '直接成单奖励', '跟单成功奖励',\n",
       "       '直接成单数最高者奖励', '跟成单数最高者奖励', '跟单成功数最高者奖励', '总成单数最高者奖励', '总成单率最高者奖励',\n",
       "       '总工资'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_data.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>销售id</th>\n",
       "      <th>销售姓名</th>\n",
       "      <th>沟通用户总数</th>\n",
       "      <th>直接成单数</th>\n",
       "      <th>跟单成功数</th>\n",
       "      <th>总成单数</th>\n",
       "      <th>直接成单率</th>\n",
       "      <th>跟单成功率</th>\n",
       "      <th>成单率</th>\n",
       "      <th>非意向用户</th>\n",
       "      <th>...</th>\n",
       "      <th>底薪</th>\n",
       "      <th>直接成单奖励</th>\n",
       "      <th>跟单成功奖励</th>\n",
       "      <th>直接成单数最高者奖励</th>\n",
       "      <th>跟成单数最高者奖励</th>\n",
       "      <th>跟单成功数最高者奖励</th>\n",
       "      <th>总成单数最高者奖励</th>\n",
       "      <th>总成单率最高者奖励</th>\n",
       "      <th>总工资</th>\n",
       "      <th>跟单成功率最高者奖励</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>张艳</td>\n",
       "      <td>1040</td>\n",
       "      <td>66</td>\n",
       "      <td>36</td>\n",
       "      <td>102</td>\n",
       "      <td>0.0635</td>\n",
       "      <td>0.0346</td>\n",
       "      <td>0.0981</td>\n",
       "      <td>431</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>6600</td>\n",
       "      <td>2880</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>李勇</td>\n",
       "      <td>1029</td>\n",
       "      <td>54</td>\n",
       "      <td>16</td>\n",
       "      <td>70</td>\n",
       "      <td>0.0525</td>\n",
       "      <td>0.0155</td>\n",
       "      <td>0.0680</td>\n",
       "      <td>515</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>5400</td>\n",
       "      <td>1280</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>王平</td>\n",
       "      <td>1046</td>\n",
       "      <td>45</td>\n",
       "      <td>14</td>\n",
       "      <td>59</td>\n",
       "      <td>0.0430</td>\n",
       "      <td>0.0134</td>\n",
       "      <td>0.0564</td>\n",
       "      <td>385</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>4500</td>\n",
       "      <td>1120</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>李强</td>\n",
       "      <td>995</td>\n",
       "      <td>36</td>\n",
       "      <td>15</td>\n",
       "      <td>51</td>\n",
       "      <td>0.0362</td>\n",
       "      <td>0.0151</td>\n",
       "      <td>0.0513</td>\n",
       "      <td>433</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>3600</td>\n",
       "      <td>1200</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>王芳</td>\n",
       "      <td>1027</td>\n",
       "      <td>30</td>\n",
       "      <td>32</td>\n",
       "      <td>62</td>\n",
       "      <td>0.0292</td>\n",
       "      <td>0.0312</td>\n",
       "      <td>0.0604</td>\n",
       "      <td>419</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>3000</td>\n",
       "      <td>2560</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 23 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   销售id 销售姓名  沟通用户总数  直接成单数  跟单成功数  总成单数   直接成单率   跟单成功率     成单率  非意向用户  ...  \\\n",
       "0     1   张艳    1040     66     36   102  0.0635  0.0346  0.0981    431  ...   \n",
       "1     2   李勇    1029     54     16    70  0.0525  0.0155  0.0680    515  ...   \n",
       "2     3   王平    1046     45     14    59  0.0430  0.0134  0.0564    385  ...   \n",
       "3     4   李强     995     36     15    51  0.0362  0.0151  0.0513    433  ...   \n",
       "4     5   王芳    1027     30     32    62  0.0292  0.0312  0.0604    419  ...   \n",
       "\n",
       "     底薪  直接成单奖励  跟单成功奖励  直接成单数最高者奖励  跟成单数最高者奖励  跟单成功数最高者奖励  总成单数最高者奖励  \\\n",
       "0  2000    6600    2880           0          0           0          0   \n",
       "1  2000    5400    1280           0          0           0          0   \n",
       "2  2000    4500    1120           0          0           0          0   \n",
       "3  2000    3600    1200           0          0           0          0   \n",
       "4  2000    3000    2560           0          0           0          0   \n",
       "\n",
       "   总成单率最高者奖励  总工资  跟单成功率最高者奖励  \n",
       "0          0    0         NaN  \n",
       "1          0    0         NaN  \n",
       "2          0    0         NaN  \n",
       "3          0    0         NaN  \n",
       "4          0    0         NaN  \n",
       "\n",
       "[5 rows x 23 columns]"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10    24\n",
       "13    25\n",
       "20    27\n",
       "4     30\n",
       "22    32\n",
       "25    32\n",
       "3     36\n",
       "27    42\n",
       "23    43\n",
       "9     43\n",
       "2     45\n",
       "7     46\n",
       "24    47\n",
       "5     50\n",
       "15    50\n",
       "21    51\n",
       "1     54\n",
       "12    55\n",
       "17    56\n",
       "14    58\n",
       "18    59\n",
       "26    61\n",
       "29    65\n",
       "0     66\n",
       "6     71\n",
       "19    75\n",
       "11    77\n",
       "28    82\n",
       "8     83\n",
       "16    84\n",
       "Name: 直接成单数, dtype: int64"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " df_data[\"直接成单数\"].sort_values()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Int64Index([10, 13, 20,  4, 22, 25,  3, 27, 23,  9,  2,  7, 24,  5, 15, 21,  1,\n",
       "            12, 17, 14, 18, 26, 29,  0,  6, 19, 11, 28,  8, 16],\n",
       "           dtype='int64')"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " df_data[\"直接成单数\"].sort_values().index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[10,\n",
       " 13,\n",
       " 20,\n",
       " 4,\n",
       " 22,\n",
       " 25,\n",
       " 3,\n",
       " 27,\n",
       " 23,\n",
       " 9,\n",
       " 2,\n",
       " 7,\n",
       " 24,\n",
       " 5,\n",
       " 15,\n",
       " 21,\n",
       " 1,\n",
       " 12,\n",
       " 17,\n",
       " 14,\n",
       " 18,\n",
       " 26,\n",
       " 29,\n",
       " 0,\n",
       " 6,\n",
       " 19,\n",
       " 11,\n",
       " 28,\n",
       " 8,\n",
       " 16]"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " df_data[\"直接成单数\"].sort_values().index.tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "16 10 10 28 28\n"
     ]
    }
   ],
   "source": [
    "index1 = df_data[\"直接成单数\"].sort_values(ascending = False).index.tolist()[0]\n",
    "index2 = df_data[\"跟单成功率\"].sort_values(ascending = False).index.tolist()[0]\n",
    "index3 = df_data[\"跟单成功数\"].sort_values(ascending = False).index.tolist()[0]\n",
    "index4 = df_data[\"总成单数\"].sort_values(ascending = False).index.tolist()[0]\n",
    "index5 = df_data[\"成单率\"].sort_values(ascending = False).index.tolist()[0]\n",
    "print(index1,index2,index3,index4,index5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_data.loc[index1,\"直接成单数最高者奖励\"] = 2000\n",
    "df_data.loc[index2,\"跟单成功率最高者奖励\"] = 1600\n",
    "df_data.loc[index3,\"跟单成功数最高者奖励\"] = 1600\n",
    "df_data.loc[index2,\"总成单数最高者奖励\"] = 3000\n",
    "df_data.loc[index2,\"总成单率最高者奖励\"] = 3000"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_data[\"直接成单奖励\"] = df_data[\"直接成单数\"] * 100\n",
    "df_data[\"跟单成功奖励\"] = df_data[\"跟单成功数\"] * 80"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['销售id', '销售姓名', '沟通用户总数', '直接成单数', '跟单成功数', '总成单数', '直接成单率', '跟单成功率',\n",
       "       '成单率', '非意向用户', '跟单失败数', '非意向用户率', '跟单失败率', '底薪', '直接成单奖励', '跟单成功奖励',\n",
       "       '直接成单数最高者奖励', '跟成单数最高者奖励', '跟单成功数最高者奖励', '总成单数最高者奖励', '总成单率最高者奖励',\n",
       "       '总工资', '跟单成功率最高者奖励'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_data.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>销售id</th>\n",
       "      <th>销售姓名</th>\n",
       "      <th>沟通用户总数</th>\n",
       "      <th>直接成单数</th>\n",
       "      <th>跟单成功数</th>\n",
       "      <th>总成单数</th>\n",
       "      <th>直接成单率</th>\n",
       "      <th>跟单成功率</th>\n",
       "      <th>成单率</th>\n",
       "      <th>非意向用户</th>\n",
       "      <th>...</th>\n",
       "      <th>底薪</th>\n",
       "      <th>直接成单奖励</th>\n",
       "      <th>跟单成功奖励</th>\n",
       "      <th>直接成单数最高者奖励</th>\n",
       "      <th>跟成单数最高者奖励</th>\n",
       "      <th>跟单成功数最高者奖励</th>\n",
       "      <th>总成单数最高者奖励</th>\n",
       "      <th>总成单率最高者奖励</th>\n",
       "      <th>总工资</th>\n",
       "      <th>跟单成功率最高者奖励</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>张艳</td>\n",
       "      <td>1040</td>\n",
       "      <td>66</td>\n",
       "      <td>36</td>\n",
       "      <td>102</td>\n",
       "      <td>0.0635</td>\n",
       "      <td>0.0346</td>\n",
       "      <td>0.0981</td>\n",
       "      <td>431</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>6600</td>\n",
       "      <td>2880</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>11480</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>李勇</td>\n",
       "      <td>1029</td>\n",
       "      <td>54</td>\n",
       "      <td>16</td>\n",
       "      <td>70</td>\n",
       "      <td>0.0525</td>\n",
       "      <td>0.0155</td>\n",
       "      <td>0.0680</td>\n",
       "      <td>515</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>5400</td>\n",
       "      <td>1280</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8680</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>王平</td>\n",
       "      <td>1046</td>\n",
       "      <td>45</td>\n",
       "      <td>14</td>\n",
       "      <td>59</td>\n",
       "      <td>0.0430</td>\n",
       "      <td>0.0134</td>\n",
       "      <td>0.0564</td>\n",
       "      <td>385</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>4500</td>\n",
       "      <td>1120</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7620</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>李强</td>\n",
       "      <td>995</td>\n",
       "      <td>36</td>\n",
       "      <td>15</td>\n",
       "      <td>51</td>\n",
       "      <td>0.0362</td>\n",
       "      <td>0.0151</td>\n",
       "      <td>0.0513</td>\n",
       "      <td>433</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>3600</td>\n",
       "      <td>1200</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>6800</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>王芳</td>\n",
       "      <td>1027</td>\n",
       "      <td>30</td>\n",
       "      <td>32</td>\n",
       "      <td>62</td>\n",
       "      <td>0.0292</td>\n",
       "      <td>0.0312</td>\n",
       "      <td>0.0604</td>\n",
       "      <td>419</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>3000</td>\n",
       "      <td>2560</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7560</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 23 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   销售id 销售姓名  沟通用户总数  直接成单数  跟单成功数  总成单数   直接成单率   跟单成功率     成单率  非意向用户  ...  \\\n",
       "0     1   张艳    1040     66     36   102  0.0635  0.0346  0.0981    431  ...   \n",
       "1     2   李勇    1029     54     16    70  0.0525  0.0155  0.0680    515  ...   \n",
       "2     3   王平    1046     45     14    59  0.0430  0.0134  0.0564    385  ...   \n",
       "3     4   李强     995     36     15    51  0.0362  0.0151  0.0513    433  ...   \n",
       "4     5   王芳    1027     30     32    62  0.0292  0.0312  0.0604    419  ...   \n",
       "\n",
       "     底薪  直接成单奖励  跟单成功奖励  直接成单数最高者奖励  跟成单数最高者奖励  跟单成功数最高者奖励  总成单数最高者奖励  \\\n",
       "0  2000    6600    2880           0          0           0          0   \n",
       "1  2000    5400    1280           0          0           0          0   \n",
       "2  2000    4500    1120           0          0           0          0   \n",
       "3  2000    3600    1200           0          0           0          0   \n",
       "4  2000    3000    2560           0          0           0          0   \n",
       "\n",
       "   总成单率最高者奖励    总工资  跟单成功率最高者奖励  \n",
       "0          0  11480         NaN  \n",
       "1          0   8680         NaN  \n",
       "2          0   7620         NaN  \n",
       "3          0   6800         NaN  \n",
       "4          0   7560         NaN  \n",
       "\n",
       "[5 rows x 23 columns]"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_data[\"总工资\"] = (df_data[\"底薪\"] + df_data[\"直接成单奖励\"] + df_data[\"跟单成功奖励\"] + \n",
    "                  df_data[\"直接成单数最高者奖励\"] +  df_data[\"跟成单数最高者奖励\"] +\n",
    "                  df_data[\"跟单成功数最高者奖励\"] + df_data[\"总成单数最高者奖励\"] +\n",
    "                  df_data[\"总成单率最高者奖励\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     11480\n",
       "1      8680\n",
       "2      7620\n",
       "3      6800\n",
       "4      7560\n",
       "5      8760\n",
       "6     11020\n",
       "7      8920\n",
       "8     13340\n",
       "9      8460\n",
       "10    16800\n",
       "11    12340\n",
       "12    10780\n",
       "13     6980\n",
       "14     9560\n",
       "15     8520\n",
       "16    13920\n",
       "17     8880\n",
       "18    11180\n",
       "19    11100\n",
       "20     6940\n",
       "21     9660\n",
       "22     9040\n",
       "23     7500\n",
       "24     8940\n",
       "25     6480\n",
       "26     9940\n",
       "27     7400\n",
       "28    13880\n",
       "29    10500\n",
       "Name: 总工资, dtype: int64"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_data[\"总工资\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>销售id</th>\n",
       "      <th>销售姓名</th>\n",
       "      <th>沟通用户总数</th>\n",
       "      <th>直接成单数</th>\n",
       "      <th>跟单成功数</th>\n",
       "      <th>总成单数</th>\n",
       "      <th>直接成单率</th>\n",
       "      <th>跟单成功率</th>\n",
       "      <th>成单率</th>\n",
       "      <th>非意向用户</th>\n",
       "      <th>...</th>\n",
       "      <th>底薪</th>\n",
       "      <th>直接成单奖励</th>\n",
       "      <th>跟单成功奖励</th>\n",
       "      <th>直接成单数最高者奖励</th>\n",
       "      <th>跟成单数最高者奖励</th>\n",
       "      <th>跟单成功数最高者奖励</th>\n",
       "      <th>总成单数最高者奖励</th>\n",
       "      <th>总成单率最高者奖励</th>\n",
       "      <th>总工资</th>\n",
       "      <th>跟单成功率最高者奖励</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>张艳</td>\n",
       "      <td>1040</td>\n",
       "      <td>66</td>\n",
       "      <td>36</td>\n",
       "      <td>102</td>\n",
       "      <td>0.0635</td>\n",
       "      <td>0.0346</td>\n",
       "      <td>0.0981</td>\n",
       "      <td>431</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>6600</td>\n",
       "      <td>2880</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>11480</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>李勇</td>\n",
       "      <td>1029</td>\n",
       "      <td>54</td>\n",
       "      <td>16</td>\n",
       "      <td>70</td>\n",
       "      <td>0.0525</td>\n",
       "      <td>0.0155</td>\n",
       "      <td>0.0680</td>\n",
       "      <td>515</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>5400</td>\n",
       "      <td>1280</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8680</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>王平</td>\n",
       "      <td>1046</td>\n",
       "      <td>45</td>\n",
       "      <td>14</td>\n",
       "      <td>59</td>\n",
       "      <td>0.0430</td>\n",
       "      <td>0.0134</td>\n",
       "      <td>0.0564</td>\n",
       "      <td>385</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>4500</td>\n",
       "      <td>1120</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7620</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>李强</td>\n",
       "      <td>995</td>\n",
       "      <td>36</td>\n",
       "      <td>15</td>\n",
       "      <td>51</td>\n",
       "      <td>0.0362</td>\n",
       "      <td>0.0151</td>\n",
       "      <td>0.0513</td>\n",
       "      <td>433</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>3600</td>\n",
       "      <td>1200</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>6800</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>王芳</td>\n",
       "      <td>1027</td>\n",
       "      <td>30</td>\n",
       "      <td>32</td>\n",
       "      <td>62</td>\n",
       "      <td>0.0292</td>\n",
       "      <td>0.0312</td>\n",
       "      <td>0.0604</td>\n",
       "      <td>419</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>3000</td>\n",
       "      <td>2560</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7560</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 23 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   销售id 销售姓名  沟通用户总数  直接成单数  跟单成功数  总成单数   直接成单率   跟单成功率     成单率  非意向用户  ...  \\\n",
       "0     1   张艳    1040     66     36   102  0.0635  0.0346  0.0981    431  ...   \n",
       "1     2   李勇    1029     54     16    70  0.0525  0.0155  0.0680    515  ...   \n",
       "2     3   王平    1046     45     14    59  0.0430  0.0134  0.0564    385  ...   \n",
       "3     4   李强     995     36     15    51  0.0362  0.0151  0.0513    433  ...   \n",
       "4     5   王芳    1027     30     32    62  0.0292  0.0312  0.0604    419  ...   \n",
       "\n",
       "     底薪  直接成单奖励  跟单成功奖励  直接成单数最高者奖励  跟成单数最高者奖励  跟单成功数最高者奖励  总成单数最高者奖励  \\\n",
       "0  2000    6600    2880           0          0           0          0   \n",
       "1  2000    5400    1280           0          0           0          0   \n",
       "2  2000    4500    1120           0          0           0          0   \n",
       "3  2000    3600    1200           0          0           0          0   \n",
       "4  2000    3000    2560           0          0           0          0   \n",
       "\n",
       "   总成单率最高者奖励    总工资  跟单成功率最高者奖励  \n",
       "0          0  11480         NaN  \n",
       "1          0   8680         NaN  \n",
       "2          0   7620         NaN  \n",
       "3          0   6800         NaN  \n",
       "4          0   7560         NaN  \n",
       "\n",
       "[5 rows x 23 columns]"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>销售id</th>\n",
       "      <th>销售姓名</th>\n",
       "      <th>沟通用户总数</th>\n",
       "      <th>直接成单数</th>\n",
       "      <th>跟单成功数</th>\n",
       "      <th>总成单数</th>\n",
       "      <th>直接成单率</th>\n",
       "      <th>跟单成功率</th>\n",
       "      <th>成单率</th>\n",
       "      <th>非意向用户</th>\n",
       "      <th>...</th>\n",
       "      <th>底薪</th>\n",
       "      <th>直接成单奖励</th>\n",
       "      <th>跟单成功奖励</th>\n",
       "      <th>直接成单数最高者奖励</th>\n",
       "      <th>跟成单数最高者奖励</th>\n",
       "      <th>跟单成功数最高者奖励</th>\n",
       "      <th>总成单数最高者奖励</th>\n",
       "      <th>总成单率最高者奖励</th>\n",
       "      <th>总工资</th>\n",
       "      <th>跟单成功率最高者奖励</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>11</td>\n",
       "      <td>张秀英</td>\n",
       "      <td>1039</td>\n",
       "      <td>24</td>\n",
       "      <td>60</td>\n",
       "      <td>84</td>\n",
       "      <td>0.0231</td>\n",
       "      <td>0.0577</td>\n",
       "      <td>0.0808</td>\n",
       "      <td>406</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>2400</td>\n",
       "      <td>4800</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1600</td>\n",
       "      <td>3000</td>\n",
       "      <td>3000</td>\n",
       "      <td>16800</td>\n",
       "      <td>1600.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>17</td>\n",
       "      <td>张杰</td>\n",
       "      <td>1048</td>\n",
       "      <td>84</td>\n",
       "      <td>19</td>\n",
       "      <td>103</td>\n",
       "      <td>0.0802</td>\n",
       "      <td>0.0181</td>\n",
       "      <td>0.0983</td>\n",
       "      <td>460</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>8400</td>\n",
       "      <td>1520</td>\n",
       "      <td>2000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13920</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>29</td>\n",
       "      <td>李敏</td>\n",
       "      <td>1010</td>\n",
       "      <td>82</td>\n",
       "      <td>46</td>\n",
       "      <td>128</td>\n",
       "      <td>0.0812</td>\n",
       "      <td>0.0455</td>\n",
       "      <td>0.1267</td>\n",
       "      <td>469</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>8200</td>\n",
       "      <td>3680</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13880</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>9</td>\n",
       "      <td>张勇</td>\n",
       "      <td>1045</td>\n",
       "      <td>83</td>\n",
       "      <td>38</td>\n",
       "      <td>121</td>\n",
       "      <td>0.0794</td>\n",
       "      <td>0.0364</td>\n",
       "      <td>0.1158</td>\n",
       "      <td>371</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>8300</td>\n",
       "      <td>3040</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13340</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>12</td>\n",
       "      <td>王强</td>\n",
       "      <td>1030</td>\n",
       "      <td>77</td>\n",
       "      <td>33</td>\n",
       "      <td>110</td>\n",
       "      <td>0.0748</td>\n",
       "      <td>0.0320</td>\n",
       "      <td>0.1068</td>\n",
       "      <td>455</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>7700</td>\n",
       "      <td>2640</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>12340</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>张艳</td>\n",
       "      <td>1040</td>\n",
       "      <td>66</td>\n",
       "      <td>36</td>\n",
       "      <td>102</td>\n",
       "      <td>0.0635</td>\n",
       "      <td>0.0346</td>\n",
       "      <td>0.0981</td>\n",
       "      <td>431</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>6600</td>\n",
       "      <td>2880</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>11480</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>19</td>\n",
       "      <td>王丽</td>\n",
       "      <td>1031</td>\n",
       "      <td>59</td>\n",
       "      <td>41</td>\n",
       "      <td>100</td>\n",
       "      <td>0.0572</td>\n",
       "      <td>0.0398</td>\n",
       "      <td>0.0970</td>\n",
       "      <td>444</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>5900</td>\n",
       "      <td>3280</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>11180</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>20</td>\n",
       "      <td>王艳</td>\n",
       "      <td>1041</td>\n",
       "      <td>75</td>\n",
       "      <td>20</td>\n",
       "      <td>95</td>\n",
       "      <td>0.0720</td>\n",
       "      <td>0.0192</td>\n",
       "      <td>0.0913</td>\n",
       "      <td>440</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>7500</td>\n",
       "      <td>1600</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>11100</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7</td>\n",
       "      <td>李伟</td>\n",
       "      <td>1040</td>\n",
       "      <td>71</td>\n",
       "      <td>24</td>\n",
       "      <td>95</td>\n",
       "      <td>0.0683</td>\n",
       "      <td>0.0231</td>\n",
       "      <td>0.0913</td>\n",
       "      <td>442</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>7100</td>\n",
       "      <td>1920</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>11020</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>13</td>\n",
       "      <td>李军</td>\n",
       "      <td>1087</td>\n",
       "      <td>55</td>\n",
       "      <td>41</td>\n",
       "      <td>96</td>\n",
       "      <td>0.0506</td>\n",
       "      <td>0.0377</td>\n",
       "      <td>0.0883</td>\n",
       "      <td>430</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>5500</td>\n",
       "      <td>3280</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10780</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>30</td>\n",
       "      <td>张敏</td>\n",
       "      <td>1042</td>\n",
       "      <td>65</td>\n",
       "      <td>25</td>\n",
       "      <td>90</td>\n",
       "      <td>0.0624</td>\n",
       "      <td>0.0240</td>\n",
       "      <td>0.0864</td>\n",
       "      <td>404</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>6500</td>\n",
       "      <td>2000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10500</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>27</td>\n",
       "      <td>王伟</td>\n",
       "      <td>1024</td>\n",
       "      <td>61</td>\n",
       "      <td>23</td>\n",
       "      <td>84</td>\n",
       "      <td>0.0596</td>\n",
       "      <td>0.0225</td>\n",
       "      <td>0.0820</td>\n",
       "      <td>442</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>6100</td>\n",
       "      <td>1840</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>9940</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>22</td>\n",
       "      <td>王超</td>\n",
       "      <td>1029</td>\n",
       "      <td>51</td>\n",
       "      <td>32</td>\n",
       "      <td>83</td>\n",
       "      <td>0.0496</td>\n",
       "      <td>0.0311</td>\n",
       "      <td>0.0807</td>\n",
       "      <td>545</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>5100</td>\n",
       "      <td>2560</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>9660</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>15</td>\n",
       "      <td>张涛</td>\n",
       "      <td>1050</td>\n",
       "      <td>58</td>\n",
       "      <td>22</td>\n",
       "      <td>80</td>\n",
       "      <td>0.0552</td>\n",
       "      <td>0.0210</td>\n",
       "      <td>0.0762</td>\n",
       "      <td>513</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>5800</td>\n",
       "      <td>1760</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>9560</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>23</td>\n",
       "      <td>王杰</td>\n",
       "      <td>1037</td>\n",
       "      <td>32</td>\n",
       "      <td>48</td>\n",
       "      <td>80</td>\n",
       "      <td>0.0309</td>\n",
       "      <td>0.0463</td>\n",
       "      <td>0.0771</td>\n",
       "      <td>514</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>3200</td>\n",
       "      <td>3840</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>9040</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>25</td>\n",
       "      <td>李静</td>\n",
       "      <td>1025</td>\n",
       "      <td>47</td>\n",
       "      <td>28</td>\n",
       "      <td>75</td>\n",
       "      <td>0.0459</td>\n",
       "      <td>0.0273</td>\n",
       "      <td>0.0732</td>\n",
       "      <td>453</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>4700</td>\n",
       "      <td>2240</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8940</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8</td>\n",
       "      <td>刘洋</td>\n",
       "      <td>1042</td>\n",
       "      <td>46</td>\n",
       "      <td>29</td>\n",
       "      <td>75</td>\n",
       "      <td>0.0441</td>\n",
       "      <td>0.0278</td>\n",
       "      <td>0.0720</td>\n",
       "      <td>411</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>4600</td>\n",
       "      <td>2320</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8920</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>18</td>\n",
       "      <td>张静</td>\n",
       "      <td>1039</td>\n",
       "      <td>56</td>\n",
       "      <td>16</td>\n",
       "      <td>72</td>\n",
       "      <td>0.0539</td>\n",
       "      <td>0.0154</td>\n",
       "      <td>0.0693</td>\n",
       "      <td>404</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>5600</td>\n",
       "      <td>1280</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8880</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6</td>\n",
       "      <td>王军</td>\n",
       "      <td>1058</td>\n",
       "      <td>50</td>\n",
       "      <td>22</td>\n",
       "      <td>72</td>\n",
       "      <td>0.0473</td>\n",
       "      <td>0.0208</td>\n",
       "      <td>0.0681</td>\n",
       "      <td>476</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>5000</td>\n",
       "      <td>1760</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8760</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>李勇</td>\n",
       "      <td>1029</td>\n",
       "      <td>54</td>\n",
       "      <td>16</td>\n",
       "      <td>70</td>\n",
       "      <td>0.0525</td>\n",
       "      <td>0.0155</td>\n",
       "      <td>0.0680</td>\n",
       "      <td>515</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>5400</td>\n",
       "      <td>1280</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8680</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>16</td>\n",
       "      <td>刘芳</td>\n",
       "      <td>1054</td>\n",
       "      <td>50</td>\n",
       "      <td>19</td>\n",
       "      <td>69</td>\n",
       "      <td>0.0474</td>\n",
       "      <td>0.0180</td>\n",
       "      <td>0.0655</td>\n",
       "      <td>440</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>5000</td>\n",
       "      <td>1520</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8520</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10</td>\n",
       "      <td>王勇</td>\n",
       "      <td>1055</td>\n",
       "      <td>43</td>\n",
       "      <td>27</td>\n",
       "      <td>70</td>\n",
       "      <td>0.0408</td>\n",
       "      <td>0.0256</td>\n",
       "      <td>0.0664</td>\n",
       "      <td>504</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>4300</td>\n",
       "      <td>2160</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8460</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>王平</td>\n",
       "      <td>1046</td>\n",
       "      <td>45</td>\n",
       "      <td>14</td>\n",
       "      <td>59</td>\n",
       "      <td>0.0430</td>\n",
       "      <td>0.0134</td>\n",
       "      <td>0.0564</td>\n",
       "      <td>385</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>4500</td>\n",
       "      <td>1120</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7620</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>王芳</td>\n",
       "      <td>1027</td>\n",
       "      <td>30</td>\n",
       "      <td>32</td>\n",
       "      <td>62</td>\n",
       "      <td>0.0292</td>\n",
       "      <td>0.0312</td>\n",
       "      <td>0.0604</td>\n",
       "      <td>419</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>3000</td>\n",
       "      <td>2560</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7560</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>24</td>\n",
       "      <td>张丽</td>\n",
       "      <td>1029</td>\n",
       "      <td>43</td>\n",
       "      <td>15</td>\n",
       "      <td>58</td>\n",
       "      <td>0.0418</td>\n",
       "      <td>0.0146</td>\n",
       "      <td>0.0564</td>\n",
       "      <td>572</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>4300</td>\n",
       "      <td>1200</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7500</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>28</td>\n",
       "      <td>王秀兰</td>\n",
       "      <td>1018</td>\n",
       "      <td>42</td>\n",
       "      <td>15</td>\n",
       "      <td>57</td>\n",
       "      <td>0.0413</td>\n",
       "      <td>0.0147</td>\n",
       "      <td>0.0560</td>\n",
       "      <td>491</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>4200</td>\n",
       "      <td>1200</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7400</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>14</td>\n",
       "      <td>王娟</td>\n",
       "      <td>1035</td>\n",
       "      <td>25</td>\n",
       "      <td>31</td>\n",
       "      <td>56</td>\n",
       "      <td>0.0242</td>\n",
       "      <td>0.0300</td>\n",
       "      <td>0.0541</td>\n",
       "      <td>462</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>2500</td>\n",
       "      <td>2480</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>6980</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>21</td>\n",
       "      <td>张磊</td>\n",
       "      <td>1034</td>\n",
       "      <td>27</td>\n",
       "      <td>28</td>\n",
       "      <td>55</td>\n",
       "      <td>0.0261</td>\n",
       "      <td>0.0271</td>\n",
       "      <td>0.0532</td>\n",
       "      <td>552</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>2700</td>\n",
       "      <td>2240</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>6940</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>李强</td>\n",
       "      <td>995</td>\n",
       "      <td>36</td>\n",
       "      <td>15</td>\n",
       "      <td>51</td>\n",
       "      <td>0.0362</td>\n",
       "      <td>0.0151</td>\n",
       "      <td>0.0513</td>\n",
       "      <td>433</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>3600</td>\n",
       "      <td>1200</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>6800</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>26</td>\n",
       "      <td>王敏</td>\n",
       "      <td>1070</td>\n",
       "      <td>32</td>\n",
       "      <td>16</td>\n",
       "      <td>48</td>\n",
       "      <td>0.0299</td>\n",
       "      <td>0.0150</td>\n",
       "      <td>0.0449</td>\n",
       "      <td>491</td>\n",
       "      <td>...</td>\n",
       "      <td>2000</td>\n",
       "      <td>3200</td>\n",
       "      <td>1280</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>6480</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>30 rows × 23 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    销售id 销售姓名  沟通用户总数  直接成单数  跟单成功数  总成单数   直接成单率   跟单成功率     成单率  非意向用户  ...  \\\n",
       "10    11  张秀英    1039     24     60    84  0.0231  0.0577  0.0808    406  ...   \n",
       "16    17   张杰    1048     84     19   103  0.0802  0.0181  0.0983    460  ...   \n",
       "28    29   李敏    1010     82     46   128  0.0812  0.0455  0.1267    469  ...   \n",
       "8      9   张勇    1045     83     38   121  0.0794  0.0364  0.1158    371  ...   \n",
       "11    12   王强    1030     77     33   110  0.0748  0.0320  0.1068    455  ...   \n",
       "0      1   张艳    1040     66     36   102  0.0635  0.0346  0.0981    431  ...   \n",
       "18    19   王丽    1031     59     41   100  0.0572  0.0398  0.0970    444  ...   \n",
       "19    20   王艳    1041     75     20    95  0.0720  0.0192  0.0913    440  ...   \n",
       "6      7   李伟    1040     71     24    95  0.0683  0.0231  0.0913    442  ...   \n",
       "12    13   李军    1087     55     41    96  0.0506  0.0377  0.0883    430  ...   \n",
       "29    30   张敏    1042     65     25    90  0.0624  0.0240  0.0864    404  ...   \n",
       "26    27   王伟    1024     61     23    84  0.0596  0.0225  0.0820    442  ...   \n",
       "21    22   王超    1029     51     32    83  0.0496  0.0311  0.0807    545  ...   \n",
       "14    15   张涛    1050     58     22    80  0.0552  0.0210  0.0762    513  ...   \n",
       "22    23   王杰    1037     32     48    80  0.0309  0.0463  0.0771    514  ...   \n",
       "24    25   李静    1025     47     28    75  0.0459  0.0273  0.0732    453  ...   \n",
       "7      8   刘洋    1042     46     29    75  0.0441  0.0278  0.0720    411  ...   \n",
       "17    18   张静    1039     56     16    72  0.0539  0.0154  0.0693    404  ...   \n",
       "5      6   王军    1058     50     22    72  0.0473  0.0208  0.0681    476  ...   \n",
       "1      2   李勇    1029     54     16    70  0.0525  0.0155  0.0680    515  ...   \n",
       "15    16   刘芳    1054     50     19    69  0.0474  0.0180  0.0655    440  ...   \n",
       "9     10   王勇    1055     43     27    70  0.0408  0.0256  0.0664    504  ...   \n",
       "2      3   王平    1046     45     14    59  0.0430  0.0134  0.0564    385  ...   \n",
       "4      5   王芳    1027     30     32    62  0.0292  0.0312  0.0604    419  ...   \n",
       "23    24   张丽    1029     43     15    58  0.0418  0.0146  0.0564    572  ...   \n",
       "27    28  王秀兰    1018     42     15    57  0.0413  0.0147  0.0560    491  ...   \n",
       "13    14   王娟    1035     25     31    56  0.0242  0.0300  0.0541    462  ...   \n",
       "20    21   张磊    1034     27     28    55  0.0261  0.0271  0.0532    552  ...   \n",
       "3      4   李强     995     36     15    51  0.0362  0.0151  0.0513    433  ...   \n",
       "25    26   王敏    1070     32     16    48  0.0299  0.0150  0.0449    491  ...   \n",
       "\n",
       "      底薪  直接成单奖励  跟单成功奖励  直接成单数最高者奖励  跟成单数最高者奖励  跟单成功数最高者奖励  总成单数最高者奖励  \\\n",
       "10  2000    2400    4800           0          0        1600       3000   \n",
       "16  2000    8400    1520        2000          0           0          0   \n",
       "28  2000    8200    3680           0          0           0          0   \n",
       "8   2000    8300    3040           0          0           0          0   \n",
       "11  2000    7700    2640           0          0           0          0   \n",
       "0   2000    6600    2880           0          0           0          0   \n",
       "18  2000    5900    3280           0          0           0          0   \n",
       "19  2000    7500    1600           0          0           0          0   \n",
       "6   2000    7100    1920           0          0           0          0   \n",
       "12  2000    5500    3280           0          0           0          0   \n",
       "29  2000    6500    2000           0          0           0          0   \n",
       "26  2000    6100    1840           0          0           0          0   \n",
       "21  2000    5100    2560           0          0           0          0   \n",
       "14  2000    5800    1760           0          0           0          0   \n",
       "22  2000    3200    3840           0          0           0          0   \n",
       "24  2000    4700    2240           0          0           0          0   \n",
       "7   2000    4600    2320           0          0           0          0   \n",
       "17  2000    5600    1280           0          0           0          0   \n",
       "5   2000    5000    1760           0          0           0          0   \n",
       "1   2000    5400    1280           0          0           0          0   \n",
       "15  2000    5000    1520           0          0           0          0   \n",
       "9   2000    4300    2160           0          0           0          0   \n",
       "2   2000    4500    1120           0          0           0          0   \n",
       "4   2000    3000    2560           0          0           0          0   \n",
       "23  2000    4300    1200           0          0           0          0   \n",
       "27  2000    4200    1200           0          0           0          0   \n",
       "13  2000    2500    2480           0          0           0          0   \n",
       "20  2000    2700    2240           0          0           0          0   \n",
       "3   2000    3600    1200           0          0           0          0   \n",
       "25  2000    3200    1280           0          0           0          0   \n",
       "\n",
       "    总成单率最高者奖励    总工资  跟单成功率最高者奖励  \n",
       "10       3000  16800      1600.0  \n",
       "16          0  13920         NaN  \n",
       "28          0  13880         NaN  \n",
       "8           0  13340         NaN  \n",
       "11          0  12340         NaN  \n",
       "0           0  11480         NaN  \n",
       "18          0  11180         NaN  \n",
       "19          0  11100         NaN  \n",
       "6           0  11020         NaN  \n",
       "12          0  10780         NaN  \n",
       "29          0  10500         NaN  \n",
       "26          0   9940         NaN  \n",
       "21          0   9660         NaN  \n",
       "14          0   9560         NaN  \n",
       "22          0   9040         NaN  \n",
       "24          0   8940         NaN  \n",
       "7           0   8920         NaN  \n",
       "17          0   8880         NaN  \n",
       "5           0   8760         NaN  \n",
       "1           0   8680         NaN  \n",
       "15          0   8520         NaN  \n",
       "9           0   8460         NaN  \n",
       "2           0   7620         NaN  \n",
       "4           0   7560         NaN  \n",
       "23          0   7500         NaN  \n",
       "27          0   7400         NaN  \n",
       "13          0   6980         NaN  \n",
       "20          0   6940         NaN  \n",
       "3           0   6800         NaN  \n",
       "25          0   6480         NaN  \n",
       "\n",
       "[30 rows x 23 columns]"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_data.sort_values(by = \"总工资\",ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_data.to_sql(\n",
    "    \"2020-06 salary\",\n",
    "    conn,\n",
    "    index = False,\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
